/*
 * adcPacketStructs.h
 *
 * Created: 6/13/2013 2:55:54 AM
 *  Author: Tim
 */ 


#ifndef ADCPACKETSTRUCTS_H_
#define ADCPACKETSTRUCTS_H_



/*********ADC*********/

typedef enum
{
	ADC_CH0_bp		=	0x01,	
	ADC_CH1_bp		=	0x02,
	ADC_CH2_bp		=	0x04,
	ADC_CH3_bp		=	0x08
}ACHM_t;

typedef enum
{
	ADC_CH0_msk		=	0x00,
	ADC_CH1_msk		=	0x01,
	ADC_CH2_msk		=	0x02,
	ADC_CH3_msk		=	0x03
}ACHN_t;

typedef struct adcInitAsync_msg
{
	uint8_t Header;
	uint8_t msgHeader;
	struct adcInitAsync_parameterByte1
	{
		uint8_t	GAIN		:3;
		uint8_t RESERVED	:1;
		uint8_t ACHM		:4;
		
	}PARAM1;
	
	struct adcInitAsync_parameterByte2
	{
		uint8_t FREQH;
	}PARAM2;
	
	struct adcInitAsync_parameterByte3
	{
		uint8_t FREQL;
	}PARAM3;
	
	uint16_t checkSum;
}adcInitAsync_t;

//this message originates from the DAQ
typedef struct adcResult_msg
{
	uint8_t Header;
	uint8_t msgHeader;
	
	struct adcResult_parameterByte1
	{
		uint8_t ADCRH0;
	}PARAM1;
	
	struct adcResult_parameterByte2
	{
		uint8_t ADCRL0;
	}PARAM2;
	
	struct adcResult_parameterByte3
	{
		uint8_t ADCRH1;
	}PARAM3;
	
	struct adcResult_parameterByte4
	{
		uint8_t ADCRL1;
	}PARAM4;
	
	struct adcResult_parameterByte5
	{
		uint8_t ADCRH2;
	}PARAM5;
	
	struct adcResult_parameterByte6
	{
		uint8_t ADCRL2;
	}PARAM6;
	
	struct adcResult_parameterByte7
	{
		uint8_t ADCRH3;
	}PARAM7;
	
	struct adcResult_parameterByte8
	{
		uint8_t ADCRL3;
	}PARAM8;
	
	uint16_t checkSum;
}adcResult_t;

typedef struct adcFlashInit_msg
{
	uint8_t Header;
	uint8_t msgHeader;
	struct adcFlashInit_parameterByte1
	{
		uint8_t	GAIN		:3;
		uint8_t RESERVED	:1;
		uint8_t ACHM		:4;
		
	}PARAM1;
	
	struct adcFlashInit_parameterByte2
	{
		uint8_t FREQH;
	}PARAM2;
	
	struct adcFlashInit_parameterByte3
	{
		uint8_t FREQL;
	}PARAM3;
	
	struct adcFlashInit_parameterByte4
	{
		uint8_t SMPSH;
	}PARAM4;
	
	struct adcFlashInit_parameterByte5
	{
		uint8_t SMPSL;
	}PARAM5;
	
	uint16_t checkSum;
}adcFlashInit_t;

#endif /* ADCPACKETSTRUCTS_H_ */